<template>
    <view>
        <view class=""
              v-if="list.length>0">
            <view class="card"
                  v-for="item in list"
                  @click="godetail(item)">
                <view class="top ls-f-ajsb">
                    <view class="ls-f-ac">
                        <image src="../../../static/images/common_icon_jxyb@2x.png"
                               class="icon"
                               mode=""></image>
                        <view class="title">教学月报</view>
                    </view>
                    <view class="time">
                        {{item.addTime||""}}
                    </view>
                </view>
                <view class="content">
                    您在本月总计教学{{item.statistics||0}}课时，请假{{item.leaves||0}}次，代课{{item.taskClasss||0}}次，继续加油哦！
                </view>
                <view class="bottom">
                    <view class="count-time">
                        统计时间：{{item.addTime||""}}
                    </view>
                    <view class="ls-f-ajsb count">
                        <view class="ls-f-column ls-f-ac">
                            <view class="number">{{item.statistics||0}}</view>
                            <view class="count-time">共教学课时</view>
                        </view>
                        <view class="ls-f-column ls-f-ac">
                            <view class="number">{{item.leaves||0}}</view>
                            <view class="count-time">请假次数</view>
                        </view>
                        <view class="ls-f-column ls-f-ac">
                            <view class="number">{{item.taskClasss||0}}</view>
                            <view class="count-time">代课次数</view>
                        </view>
                    </view>
                </view>

            </view>

        </view>
        <view class=""
              v-if="list.length==0">
            <meu-empty top="65vh"
                       tipText="暂无课时统计~" />
        </view>

    </view>
</template>

<script>
export default {
    data() {
        return {
            list: []
        }
    },
    methods: {
        godetail(e) {
            let aa = JSON.stringify(e);
            uni.navigateTo({
                url: 'countDetail?item=' + aa
            })
        },
        tearcherStatistics() {
            this.$api.tearcherStatistics({ pageSize: 100 }, res => {
                console.log(res.data);
                if (res.code == 0) {
                    this.list = res.data.list
                }

            })
        }
    },
    onLoad() {
        this.tearcherStatistics()
    }
}
</script>

<style scoped lang="scss">
.count {
    margin-top: 50rpx;
    padding: 0 32rpx;
}
.number {
    color: #333333;
    font-size: 48rpx;
    font-weight: bold;
}
.title {
    font-size: 36rpx;
    font-weight: bold;
}
.time {
    color: #999999;
    font-size: 24rpx;
}
.count-time {
    color: #999999;
    font-size: 24rpx;
}
.bottom {
    padding: 16rpx;
    width: 622rpx;
    height: 230rpx;
    background: #f5f5f5;
    margin-top: 20rpx;
    border-radius: 16rpx;
}
.icon {
    width: 48rpx;
    height: 48rpx;
    margin-right: 20rpx;
}
.card {
    margin-left: 32rpx;
    margin-top: 32rpx;
    width: 686rpx;

    background: #ffffff;
    padding: 32rpx;
    border-radius: 32rpx;
    .content {
        margin-top: 29rpx;
        color: #333333;
        font-size: 28rpx;
    }
}
</style>
